import config
import sys
# 添加环境变量
sys.path.append(config.PROJECT_PATH)
lib_path = '/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/'
sys.path.append(lib_path)

import unittest
import config
import time
from lib.HTMLTestRunner import HTMLTestReportCN
from script.test_01_login import TestLogin

test_suite = unittest.TestSuite(unittest.makeSuite(TestLogin))

# port_path = config.PROJECT_PATH + f'/report/report_{time.strftime("%Y%m%d_%H%M%S")}.html'
port_path = config.PROJECT_PATH + '/report/report.html'

with open(port_path, 'wb') as file:
    runner = HTMLTestReportCN(file,
                              title='接口自动化测试报告',
                              description='测试环境接口自动化测试版本',
                              tester='耿耿')
    runner.run(test_suite)